<template>
    <div class="img-wrapper">
        <img
            v-if="src"
            class="img"
            :src="`data:image/jpg;base64,${src}`"
            alt="pdf"
        />
        <div
            v-else
            class="iconfont-wrap"
        >
            <i class="iconfont icon-loading"></i>
        </div>
    </div>
</template>

<script>
export default {
    name: 'Img',
    props: {
        src: {
            type: String,
            default: '',
        },
    },
    data() {
        return {};
    },
    watch: {},
    methods: {},
};
</script>

<style scoped lang="less">
.img-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    width: 100%;
    height: 100%;

    .img {
        width: 100%;
    }

    .iconfont-wrap {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }
}
</style>
